/*
========================================================================
 Name        : ExportContactsListBox.h
 Author      : etouch.cc
 Copyright   : etouch.cc,All Right Reserved!
 Description : 
========================================================================
*/
#ifndef EXPORTCONTACTSLISTBOX_H
#define EXPORTCONTACTSLISTBOX_H
 
#include <coecntrl.h>	 
 
class MEikCommandObserver;		
class CAknDoubleStyle2ListBox;
class CEikTextListBox;
class ContactEngine;

class CExportContactsListBox : public CCoeControl
{
public: 
	enum TControls
	{	 
		EFileSelectListBox,	
		ELastControl
	};
	enum TListBoxImages
	{
		 
		
	};
	enum TFileSelectListBoxImages
	{		 
		EFileSelectListBoxFirstUserImageIndex	
	};
	
public:	 
	CExportContactsListBox();
	static CExportContactsListBox* NewL( const TRect& aRect, 
										 const CCoeControl* aParent, 
										 MEikCommandObserver* aCommandObserver 
									    );
	static CExportContactsListBox* NewLC( const TRect& aRect, 
										  const CCoeControl* aParent, 
										  MEikCommandObserver* aCommandObserver 
										 );
	void ConstructL( const TRect& aRect, 
					 const CCoeControl* aParent, 
					 MEikCommandObserver* aCommandObserver
					);
	virtual ~CExportContactsListBox();

public:	 
	TInt CountComponentControls() const;
	CCoeControl* ComponentControl( TInt aIndex ) const;
	TKeyResponse OfferKeyEventL( const TKeyEvent& aKeyEvent, TEventCode aType );
	void HandleResourceChange( TInt aType );	
	void HandlePointerEventL(const TPointerEvent& aPointerEvent);
	 
public: 
	static void AddListBoxItemL(CEikTextListBox* aListBox,const TDesC& aString );
	static RArray< TInt >* GetSelectedListBoxItemsLC( CEikTextListBox* aListBox );
	static void DeleteSelectedListBoxItemsL( CEikTextListBox* aListBox );
	CAknDoubleStyle2ListBox* FileSelectListBox();
	static void CreateFileSelectListBoxItemL( TDes& aBuffer, 
											  const TDesC& aMainText,
											  const TDesC& aSecondaryText );
	void  AddFileSelectListBoxResourceArrayItemL( TInt aResourceId );
	void  SetupFileSelectListBoxIconsL();
	TBool HandleMarkableListCommandL( TInt aCommand );
	static TInt RunDeleteQurryL( const TDesC* aOverrideText = NULL);
	
public:
	void SetContactEngine(ContactEngine* aContactEngine);
	void FillListBoxWithContacts();
	void DeleteSelectedContact();
	TInt ListBoxItemCount();
	
protected:	 
	void SizeChanged(); 
	void Draw( const TRect& aRect ) const; 
	void InitializeControlsL();
	void LayoutControls();
	
	
private: 
	CAknDoubleStyle2ListBox* iContactListBox;
	MEikCommandObserver* 	 iCommandObserver;
	CCoeControl* 		     iFocusControl;
	ContactEngine*           iContactEngine;

};
				
#endif // EXPORTCONTACTSLISTBOX_H
